package com.fw.demo.model;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.fw.common.model.AbstractModel;

/**
 * 用户表
 * @author Administrator
 *
 */
@Entity
@Table(name="tb_users")
public class User extends AbstractModel{
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "REC_ID",  nullable = false, length = 36)
	private Long recid;											//用户ID
	@Column(name = "real_Name")									
	private String realName;									//真是姓名
	@Column(name = "sub_Company")
	private String subCompany;									//公司
	@Column(name = "department")
	private String department;									//部门
	@Column(name = "Email")
	private String mail;										//电子邮件
	@Column(name = "moblie")
	private String mobile;										//电话号码
	@Column(name = "user_Type")
	private String userType;									//用户类型
	@Column(name = "status")
	private String status;										//用户状态
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_Time" ,length = 7)
	private Date createTime;									//创建时间
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "modefy_Time" ,length = 7)
	private Date modifytime;									//修改时间
	@Column(name = "belong_Group" ,length = 7)
	private String group;                                       //所属组
	@Column(name = "user_Role" ,length = 7)
	private String role;										//用户身份 					
	@Column(name = "user_Name",unique = true, nullable = false, length = 100)
	private String username;
	@Column(name = "password")
	private String password;
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "user")
	private Set<UserRole> userRole = new HashSet<UserRole>(0);
	
	public Long getRecid() {
		return recid;
	}
	public void setRecid(Long recid) {
		this.recid = recid;
	}
	public String getRealName() {
		return realName;
	}
	public void setRealName(String realName) {
		this.realName = realName;
	}
	public String getSubCompany() {
		return subCompany;
	}
	public void setSubCompany(String subCompany) {
		this.subCompany = subCompany;
	}
	public String getDepartment() {
		return department;
	}
	public void setDepartment(String department) {
		this.department = department;
	}
	public String getMail() {
		return mail;
	}
	public void setMail(String mail) {
		this.mail = mail;
	}
	public String getMobile() {
		return mobile;
	}
	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	public String getUserType() {
		return userType;
	}
	public void setUserType(String userType) {
		this.userType = userType;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	public Date getModifytime() {
		return modifytime;
	}
	public void setModifytime(Date modifytime) {
		this.modifytime = modifytime;
	}
	public String getGroup() {
		return group;
	}
	public void setGroup(String group) {
		this.group = group;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}

	public String getRole() {
		return role;
	}
	public void setRole(String role) {
		this.role = role;
	}
	
	

}
